package visitor

import (
	"github.com/flipped-aurora/gin-vue-admin/server/api/v1"
	"github.com/flipped-aurora/gin-vue-admin/server/middleware"
	"github.com/gin-gonic/gin"
)

type VisitRouter struct {
}

// InitVisitRouter 初始化 visit表 路由信息
func (s *VisitRouter) InitVisitRouter(Router *gin.RouterGroup) {
	visitRouter := Router.Group("visit").Use(middleware.OperationRecord())
	visitRouterWithoutRecord := Router.Group("visit")
	var visitApi = v1.ApiGroupApp.VisitorApiGroup.VisitApi
	{
		visitRouter.POST("createVisit", visitApi.CreateVisit)   // 新建visit表
		visitRouter.DELETE("deleteVisit", visitApi.DeleteVisit) // 删除visit表
		visitRouter.DELETE("deleteVisitByIds", visitApi.DeleteVisitByIds) // 批量删除visit表
		visitRouter.PUT("updateVisit", visitApi.UpdateVisit)    // 更新visit表
	}
	{
		visitRouterWithoutRecord.GET("findVisit", visitApi.FindVisit)        // 根据ID获取visit表
		visitRouterWithoutRecord.GET("getVisitList", visitApi.GetVisitList)  // 获取visit表列表
	}
}
